<?php include './application/views/zhs_mobile/header.php';?>
<script>
function formSubmit(){
	document.getElementById("tender_form").submit();
}
function account_log_more(id){
	var page = parseInt(document.getElementById('account_log_page').value);
	var str = "";
	$.ajax({
		type: "GET",
		url: "/zhs_mobile/borrow/tz_log_more/"+page,
		data: "id="+id,
		success: function(ret){
			if(ret.length>0){
		        for(var i=0;i<ret.length;i++){
			        if(i%2 != 0) str += "<tr style='background-color: rgb(237, 237, 237);'>";
			        else str += "<tr>";

					str += "<td>"+ret[i].username +"</td>";
					str += "<td>"+ret[i].add_time +"</td>";
					str += "<td>"+"￥ "+ret[i].money+"</td>";
					str += "<td>"+ret[i].reslt+"</td>";
					str += "</tr>";
		        }
		        page = page+ret.length;
		    	document.getElementById('account_log_page').value=page;
		        var oldstr = document.getElementById('account_log_tab').innerHTML;
		    	document.getElementById('account_log_tab').innerHTML = oldstr+str;
			}
		},
		dataType: "json"
	});
}
</script>
<?php 
$borrname="";
$borrimg = "yp.jpg";
if(1==$borrow['ftype']){
	$borrname = CON_NAME."-配资 ".$borrow['id']."";
	$borrimg = "yp.jpg";
}elseif (2==$borrow['ftype']){
	$borrname = CON_NAME."-红本".$borrow['id']."";
	$borrimg = "hb.jpg";
}elseif (3==$borrow['ftype']){
	$borrname = CON_NAME."-车贷  ".$borrow['id']."";
	$borrimg = "zp.jpg";
}
?>
<section class="invbd main">
   <dl class="xqdl">
     
     <dd><h1><em><?php echo $borrname;?></em></h1></dd>
     <dt>
     	
    
     	<h4>
     		
     		<span>年化利率:<em><?php echo $borrow['apr'];?>% 
				<?php if($borrow['award']=='1') echo "<img title='{$borrow['funds']}%' src='/static/zhsjr/images/jiang.png'/>{$borrow['funds']}%"; elseif($borrow['award']=='2') echo "<img  title='{$borrow['funds']}元'  src='/static/zhsjr/images/jiang.png'/>{$borrow['funds']}元";?></em>
				</span>
				</h4>
				<h4>
     		 	<span>融资期限:<em><?php if($borrow['is_day'] == '1') echo " ".$borrow['bill_times']." 天"; else echo " ".$borrow['time_limit']." 月"; ?></em></span>
     		 	<span>融资金额:<em><?php echo $borrow['account'];?> </em>元</span>
     		</h4>
<h4><span>标的安全等级：<em><img title="<?php echo $borrow_fsafe[$borrow['fsafe']][0];?>" alt="<?php echo $borrow_fsafe[$borrow['fsafe']][0];?>" src="<?php echo $borrow_fsafe[$borrow['fsafe']][1];?>"></em></span></h4>
</h4>
<?php if(1==$borrow['ftype']){?>
<h4><span>担保方式：到期由<em><?php echo $borrow_bill_bank[$borrow['bill_bank']];?></em>无条件兑付</span></h4>
<?php }?>
<h4><span>最小投资金额：<em><?php echo $borrow['lowest_account'];?></em></span><span>最大投资金额：<em><?php echo $borrow['most_account'];?></em></span></h4>
<h4><span>计息方式：<em><?php echo $borrow_work_time[$borrow['work_time']];?></em></span><span>计息时间：<em><?php echo date("Y-m-d",$borrow['bill_starttime']);?></em></span></h4>
<h4> <span>还款方式：<em><?php echo $borrow_style[$borrow['style']];?></em></span></h4></dt>
   </dl>
   <form id="tender_form" method="post" action="/zhs_mobile/borrow/tender">
   <input type="hidden" id="id_bor" name="id" value="<?php echo $borrow['id'];?>" />
   <ul class="xqul">
     <li><span>请输入投资金额：</span><input class="int" type="text" name = "account" ><span>元</span></li>
     <li><span>请输入交易密码：</span><input class="int" type="password" name = "paypassword" ></li>
     <li>项目剩余可投金额：<em>¥ <?php echo round($borrow['account']-$borrow['account_yes'],2);?></em></li>
     <li>您的账户可用余额：<em>¥ <?php echo number_format($user_acnt['use_money'],2);?></em></li>
     <li>*点击确认购买投资金额并同意支付</li>
     <li><a href="javascript:formSubmit();" class="xqbtn">确认购买</a></li>
   </ul>
     </form>
   <table class="wqtqb mt">
     <thead>
       <tr>
         <th>投资人</th>
         <th>投资时间</th>
         <th>投资金额</th>
         <th>投资状态</th>
       </tr>
     </thead>
     <tbody  id="account_log_tab">
     <?php foreach ($borrow_tender_list as $ten) {?>
       <tr>
         <td>	<?php echo strdisplay_start($ten['username'],2);?></td>
         <td>	<?php echo date("Y-m-d",$ten['add_time']);?></td>
         <td>￥  <?php echo $ten['money'];?></td>
         <td>	<?php if(($ten['money'] == $ten['account']) && $ten['fstatus'] != 3){?>
				成 功<?php }elseif($borrow_tender['fstatus'] == 3){?>已撤回<?php }else{?>成 功<?php }?>
         </td>
       </tr>
       <?php }?>
     </tbody>
   </table>
    <input type="hidden" id="account_log_page" value="<?php echo $page;?>"/>
	<a href="javascript:account_log_more('<?php echo $borrow['id'];?>');" class="membtn3">查看更多 &gt;&gt;</a>
	<br/><br/><br/><br/><br/><br/>
</section>
<?php include './application/views/zhs_mobile/footer.php';?>
